#ifndef __RGB_H_
#define __RGB_H_

#include "usr_def.h"

typedef enum rgb_state
{
    RGB_STATE_RF_ERROR,
    RGB_STATE_RF_TEST_ERROR,
    RGB_STATE_OP_TEST_ERROR,
    RGB_STATE_RC_CALI,
    RGB_STATE_LOW_BATTERY,
    RGB_STATE_PAIRING,
    RGB_STATE_ARMING,
    RGB_STATE_ARMED,
    RGB_STATE_CALIBRATING,
    RGB_STATE_PROGRAMING,
    RGB_STATE_RC_LOST,
    RGB_STATE_STANDBY,
    RGB_STATE_COUNT,
};

#define RGB_STATE_SET(X) (rgb_state |= (0X0001<<(X)))
#define RGB_STATE_CLR(X) (rgb_state &= ~(0X0001<<(X)))
#define RGB_STATE_GET(X) (rgb_state & (0X0001<<(X)))

void rgb_pwm_init(void);
void rgb_task_init(void);
void rgb_set(uint8_t r, uint8_t g, uint8_t b);
void rgb(int argc, char **argv);
void rgb_state_handle();//10ms
extern uint16_t rgb_state;
#endif // !__RGB_H_
